import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:ls_work/a_elder/models/code_value_entity.dart';
import 'package:ls_work/net/post_request.dart';
import 'package:ls_work/net/response/response_data.dart';

class ComboDataModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  ///请假原因
  static const String leaveReason = "29";
  ///与长者关系
  static const String relationShip = "5";
  ///病因类型id
  static const String diseaseReason = "83";
  ///就医形式
  static const String medicalWay = "81";
  ///就医时间
  static const String medicalTimeType = "84";
  ///就医计划
  static const String medicalPlan = "82";
  ///维修类型
  static const String repairType = "10024";

  ///餐别
  static const String foodTime = "11200";
  ///是否显示点餐金额
  static const String showPrice = "38391";

  Future<List<CodeValue>> getComboData(String codeTypeId) async {
    var map = await PostRequest.getComboData(codeTypeId);
    var bean = ResponseData<CodeValue>.fromJson(map,listBuilder: (e) => CodeValue.fromJson(e));
    if("0"==bean.code){
      return bean.data?.rows??[];
    }else{
      throw(bean.msg??"");
    }
  }

  // CodeValue selectComboData(BuildContext context,List<CodeValue> list){
  //   DataPickerView(context, list)
  // }



}